package com.xio.cloud.service.fallback;

import com.xio.cloud.domain.CommonResult;
import com.xio.cloud.domain.Payment;
import com.xio.cloud.service.PaymentFeignService;
import org.springframework.stereotype.Component;

/**
 * @Author: xio
 * @Description: feign降级类
 * @Date: 2021/3/24 0:03
 */
@Component
public class PaymentFeignServiceFallBack implements PaymentFeignService {

    public static CommonResult<Payment> getPayment(Long id, Throwable throwable) {
        return new CommonResult<>(2077, " - - 84 PaymentFeignServiceFallBack id:" + id + ", is error:" + throwable);
    }

    public static CommonResult<Payment> defaultFallBack(Throwable throwable) {
        return new CommonResult<>(207, " - - 84 PaymentFeignServiceFallBack is error:" + throwable);
    }

    @Override
    public CommonResult<Payment> getPayment(Long id) {
        return new CommonResult<>(207, " - - 84 PaymentFeignServiceFallBack is error");
    }
}
